|
|
|
|
|
|
|
Visual Basic Code Profiler |
|
|
|
|
|
|
|
|
The Code Profiler is a powerful code-analyzing tool that helps you optimize your Visual Basic applications. It identifies which parts of your Visual Basic project are used most often and which ones aren't used at all. It also captures performance information about your application, such as how long it takes to run routines or parts of routines. |
|
|
|
|
|
|
|
|
The first step in using the Visual Basic Code Profiler is to install it, a process that's quite simple. To install the Code Profiler, you need to copy VBCP.DLL to your Visual Basic directory on your computer and then register it with the REGSVR32.EXE program (which can be found in \TOOLS\REGUTILS on the Visual Basic CD-ROM). To use REGSVR32.EXE, copy it into your Visual Basic directory and then drag and drop the VBCP.DLL file onto the Regsvr32 icon to register the DLL on your computer. |
|
|
|
|
|
|
|
|
The last step to install this tool is to add the following line to the VBADDIN.INI file, which is found in your Windows directory: |
|
|
|
|
|
|
|
|
[Add - Ins32]
VBCP.VBCPClass=0 |
|
|
|
|
|
|
|
|
The next time you start Visual Basic, you need to add the Code Profiler to your Add-Ins menu by using the Add-In Manager. When all this is completed, you can use the Code Profiler with your projects. |
|
|
|
|
|
|
|
|
You can use the Code Profiler to analyze the performance of your application. To get the information about your application, the Code Profiler places extra code into your project. You then run your application, testing as much of it as needed. Then, after you finish running your application, the Code Profiler creates a report on the activity it analyzed. From the analysis report, you can tell which functions are executed most often and where the computer spends most of its time during processing. You can also time your code to see how efficiently it runs. Based on what the report shows you, you can make changes to your code, allowing you to tune your application or remove unused code that takes up space. |
|
|
|
|
|
|
|
|
You also can take the data and save it as a tab-delimited file that you can then open in a spreadsheet program such as Microsoft Excel. This allows you to graph the data or view in different ways. |
|
|
|
|
|
|
|
|
Because this all sounds fairly complicated, you may be wondering what exactly happens to the application code and whether you can undo it. When you open a project in Visual Basic, it's automatically opened in the Code Profiler (if the add-in is running). When you |
|
|
|
|
|